package gzhaoku.com.common.util;

import android.content.Context;

import com.danikula.videocache.CacheListener;
import com.danikula.videocache.HttpProxyCacheServer;

import java.io.File;

import gzhaoku.com.common.Logger;

/**
 * 缓存管理器
 */
public class CacheManager {

    static final Logger log = Logger.getLog(CacheManager.class);


    private static HttpProxyCacheServer proxy;

    public static synchronized HttpProxyCacheServer getProxy(Context context) {
        if(proxy == null){
            proxy = new HttpProxyCacheServer.Builder(context)
                    .maxCacheSize(1024 * 1024 * 1024)       // 1 Gb for cache
                    .build();
        }
        return proxy;
    }

}
